﻿using System;
using FellowshipOne.API.Events.Model;

namespace MasVida.WebApi.Models.DataObject
{
    public class AttendanceSummaryDO
    {
        public int AttendanceSummaryId { get; set; }
        public DateTime? StartTime { get; set; }
        public DateTime? EndTime { get; set; }
        public int PresentCount { get; set; }
        public int AbsentCount { get; set; }
        public int TotalCount { get; set; }
        public bool Met { get; set; }
        public bool IsScheduled { get; set; }
        public bool IsPosted { get; set; }
        public string Comments { get; set; }
        public DateTime? CreatedDate { get; set; }

        public void UpdateAttendanceSummary(AttendanceSummary attendanceSummary)
        {
            attendanceSummary.Met = Met;
            attendanceSummary.IsPosted = IsPosted;
            attendanceSummary.ID = AttendanceSummaryId;
            attendanceSummary.Comments = Comments;
            attendanceSummary.CreatedDate = CreatedDate ?? attendanceSummary.CreatedDate;
            attendanceSummary.PresentCount = PresentCount;
            attendanceSummary.TotalCount = TotalCount;
            attendanceSummary.IsScheduled = IsScheduled;
            attendanceSummary.AbsentCount = AbsentCount;
            attendanceSummary.EndDateTime = EndTime ?? attendanceSummary.EndDateTime;
            attendanceSummary.StartDateTime = StartTime ?? attendanceSummary.StartDateTime;
            attendanceSummary.UpdatedDate = DateTime.Now;
        }
    }
}